You are not logged in Log in Join
You are here: Home » Members » peterbe » ZSQL - Putting ZSQL Methods into filesystem » ZSQL 0.9.3 released » View NewsItem

Log in
Name

Password

 

ZSQL 0.9.3 released

First public release of ZSQL. Makes getting .sql files into Python products much easier.

We use ZSQL heavily here at Fry-IT for all of our Zope Python products that use relational databases (we always use PostgreSQL) and want to use .sql files. The .sql files usually sit inside the product module which makes it possible to svn/grep/jed them quickly without bloating the ZODB. Since they are ZSQL Methods you can use DTML inside the SQL code too.

The added features that this has that plain ZSQL Methods don't have is:

  • Option to debug simply by passing debug__=True to the ZSQL method when you call it and you get the rendered SQL printed to stdout. Very useful.
  • Option to enable profiling. If you enable this (read about it in the README) you get a file that states all the SQL calls and how long they took in clock time. This is extremely useful for finding out what SQL methods are slowest or called too often.
  • (advanced) Option to memcache results. This is just on the getting and there's yet no easy way to invalidate the cache since the memcache key is based on the parameters. You need to install a memcached server and you need the memcached python library for this to work. Very useful for slow SQL selects that you call often. I've personally seen 10 fold speed improvements on switching this on.

Project page on www.fry-it.com/oss/ZSQL